From: Marco Trevisan (Treviño) Date: Thu, 27 Nov 2025 23:28:12 +0000 (+0100) Subject: messageTray: Disconnect to global signals on destruction X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~55^2^2~22 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8249a8d3dac7d5f8801269084902f6a9d3dbd7ca;p=gnome-shell.git messageTray: Disconnect to global signals on destruction The global display object has always a longer lifetime than anything that is initialized from JS, so avoid signals that it may emit to be handled at later point. It handles issues such as: (gnome-shell:2429): Gjs-CRITICAL **: 23:18:35.025: Object Gjs_ui_messageTray_MessageTray (0x3440ed60), has been already disposed — impossible to set any property on it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs. == Stack trace for context 0x31073eb0 == #0 348db378 i resource:///org/gnome/shell/ui/messageTray.js:1046 (3a8ac3a71f60 @ 104) #1 348db2d8 i resource:///org/gnome/shell/ui/main.js:277 (3a8ac3a0b100 @ 119) Seen in: https://gitlab.gnome.org/GNOME/gnome-shell/-/jobs/5846454 Part-of: (cherry picked from commit 1f4da30ff35577403b290648cbbc8eb4039e9d8f) --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 63bf26eaf..bd8e8b73d 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -760,7 +760,8 @@ export const MessageTray = GObject.registerClass({ Main.layoutManager.addChrome(this, {affectsInputRegion: false}); Main.layoutManager.trackChrome(this._bannerBin, {affectsInputRegion: true}); - global.display.connect('in-fullscreen-changed', this._updateState.bind(this)); + global.display.connectObject('in-fullscreen-changed', + () => this._updateState(), this); Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));